package com.martin.dms.factories.hib;

import java.util.Date;

import com.martin.dms.factories.DeliveryFactory;
import com.martin.dms.model.Delivery;
import com.martin.dms.model.Item;
import com.martin.dms.model.Supplier;
import com.martin.dms.model.hib.DeliveryHib;

/**
 * Hibernate implementation of the delivery factory.
 * 
 * @author mtsvetkov
 */
public class DeliveryFactoryHib implements DeliveryFactory {

    /**
     * {@inheritDoc}
     */
    public Delivery create(Supplier supplier, Item item, int amount, Date date) {
        DeliveryHib delivery = new DeliveryHib();
        delivery.setSupplier(supplier);
        delivery.setItem(item);
        delivery.setAmount(amount);
        delivery.setDate(date);
        return delivery;
    }

}
